﻿app.controller('CreateMessageController', ['$scope', 'MessageService', '$location', function ($scope, MessageService, $location) {
    $scope.message = {};

    $scope.createMessage = function () {
        MessageService.createMessage($scope.message, function (data) {
            alert('Message created with id ' + data);
            $location.path('/messages');
        });
    }
}]);